<?php
session_start();

require_once("../public_files/conn.php");
$user_id=$_SESSION['userid'];
if(isset($_POST['cancel_id'])){
$cancel_id=$_POST['cancel_id'];
$result=mysql_query("select * from guanzhu where (user1_id='$user_id' and user2_id='$cancel_id') or (user1_id='$cancel_id' and user2_id='$user_id')");
$row=mysql_fetch_array($result);
if($row['user1_id'] == $user_id){
$sq="update guanzhu set status2='0' where user1_id='$user_id' and user2_id='$cancel_id'";
$re=mysql_query($sq) or die (mysql_error());

}else if($row['user2_id'] == $user_id){

$sq="update guanzhu set status1='0' where user1_id='$cancel_id' and user2_id='$user_id'";
$re=mysql_query($sq) or die (mysql_error());

}

}



?>